package com.itheima.reggie.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.reggie.dto.DishDto;
import com.itheima.reggie.entity.Dish;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface DishService extends IService<Dish> {
    //新增菜品，同时新增菜品口味表，需要操作两张表
    @Transactional
    void saveWithFlavor(DishDto dishDto);
    //根据id查询菜品信息和对应的口味信息
    DishDto getByIdWithFlavor(Long id);
    //修改菜品信息
    @Transactional
    boolean updateWithFlavor(DishDto dishDto);
    //删除菜品信息；支持批量删除
    @Transactional
    boolean deleteByIds(List<Long> ids);
    //分页查询
    Page<DishDto> pages(int page, int pageSize,String name);
    //前端查询菜品
    List<DishDto> listAll(Long categoryId,Integer status);
}